package com.douban.crawl.db;

import com.douban.crawl.model.MusicComment;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class MusicCommentDao {

    private BaseDao baseDao = new BaseDao();

    public void save(MusicComment musicComment) {
        baseDao.insert(musicComment);
    }

    public List<MusicComment> getList(String musicId) {
        Map<String, String> queryMap = new HashMap<>();
        queryMap.put("music_id", musicId);
        return baseDao.getList(MusicComment.class, queryMap);
    }

    public List<MusicComment> getList(String musicId, Integer limitSize) {
        Map<String, String> queryMap = new HashMap<>();
        queryMap.put("music_id", musicId);
        return baseDao.getList(MusicComment.class, queryMap, limitSize);
    }
}
